package com.yupi.yuojcodesandbox.judge.codesandbox.enums;


import com.yupi.yuojcodesandbox.judge.codesandbox.CodeSandbox;
import com.yupi.yuojcodesandbox.judge.codesandbox.impl.QuestionSubmitStatusEnum;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.ExecuteCodeRequest;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.ExecuteCodeResponse;
import com.yupi.yuojcodesandbox.judge.codesandbox.model.JudgeInfo;

import java.util.List;

/**
 * @Author:Dong
 * @Date: 2024/4/20  10:53
 * @Version 1.0
 * 仅仅用作测试流程
 */
public class ExampleCodeSandbox implements CodeSandbox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();
        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        executeCodeResponse.setOutputList(inputList);
        executeCodeResponse.setMessage("示例代码沙箱");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPTED.getValue());
        judgeInfo.setMemory(127L);
        judgeInfo.setTime(100L);

        executeCodeResponse.setJudgeInfo(judgeInfo);
        return executeCodeResponse;

    }
}
